﻿@*仓库模块-仓库盘点*@
<style type="text/css">
    /*头部*/
    #top {
        width: 100%;
        height: 40%;
        margin-bottom: 10%;
    }
        /*文本只有下划线*/
        #top input[type='text'], #BuyOrder input[type='date'], #BuyOrder input[type='number'] {
            border: 0px;
            border-bottom: 1px solid black;
        }

    .card-body span {
        margin-left: 30px;
    }

    .card-body p {
        margin-top: 30px;
    }

    #tjo2 {
        margin-left: 400px;
    }
</style>
<section id="InventoryModule">
    @*头部*@
    <div id="top">
        <div class="card">
            <div class="card-header">仓库盘点</div>

            @using (Html.BeginForm("AddInventory", "Store", FormMethod.Post, new
            {
                @class = "addGroupFrm"
            }))
            {
                <div class="card-body">
                    <p><span>单号：<input type="text" name="InventoryID" /></span><span>
                         制单日期：&nbsp;&nbsp;<input type="date" name="CreateDate" />
                        </span><span>经办人：<input type="text" name="Operator" /></span></p>
                    <p>
                        <span>盘点库房：
                        <select class="custom-select" name="AppendType" style="width: 150px;">
                            @foreach (var item3 in ViewBag.typeList3)
                            {
                                <option value="@item3.HouseID">@item3.HouseName</option>
                            }
                        </select></span>
                        <span>盘点库区：
                        <select class="custom-select" name="HouseDetailID" style="width: 150px;">
                            @foreach (var item2 in ViewBag.typeList2)
                            {
                                <option value="@item2.HouseID">@item2.SubareaName</option>
                            }
                        </select></span><span>执行日期：&nbsp;&nbsp;<input type="date" name="TradeDate" /></span>
                    </p>
                    <p>
                        <span>盘点商品：&nbsp;&nbsp;
                         <select class="custom-select" name="ProductsID" style="width: 150px;">
                             @foreach (var item5 in ViewBag.typeList4)
                             { 
                                 <option value="@item5.ProductsID">@item5.ProductsName</option>
                             }
                         </select></span>
                    </p>
                    <p><span>账面数量：<input type="text" name="BillNum" /></span>
                        <span>实际数量：<input type="text" name="RealityNum" /></span>
                        <span>调整数量：<input type="text" name="AdjustNum" /></span></p>
                    <p><span>备注:<input type="text" name="Description" style="width: 600px;" /></span></p>
                    <p>
                        <button type="submit" class="btn btn-success" id="tjo2" style="width: 150px;">添加</button>
                    </p>
                </div>
            }
        </div>
    </div>
    @*增加*@
    <div class="modal fade" id="AddAppendStockInfoModuleModal" tabindex="-1" role="dialog" aria-labelledby="sysUserModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">提交仓库盘点信息</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    数据已添加!
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary btn-sureDelStock">确定</button>
                </div>
            </div>
        </div>
    </div>

        <div class="modal fade" id="ErrAppend" tabindex="-1" role="dialog" aria-labelledby="sysUserModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" >提交仓库盘点信息</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    数据添加失败！！！
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary btn-sureDelStock">确定</button>
                </div>
            </div>
        </div>
    </div>

</section>
<script>
    //增加
    var $addGroupFrm = $('#InventoryModule .addGroupFrm');
    $addGroupFrm.submit(function (e) {
        e.preventDefault();
        $addGroupFrm.ajaxSubmit({
            type: 'POST',
            dataType: 'json',
            success: function (e) {
               console.log(e);
               if (e) {
                   $('#AddAppendStockInfoModuleModal').modal('show');
               } else {
                   $('#ErrAppend').modal('show');
               }
            }
        });
    });

    //$(".btn-sureDelStock").click(function () {

    //});

</script>
